<?php

function canvas_rss_feed($url_string='') {
	parse_str($url_string, $vars);
	require_once (ABSPATH . WPINC . '/rss-functions.php');

	$rss = @fetch_rss($vars['feed_url']);
	if (isset($rss->items) && 0 != count($rss->items)) {
	?>
	<h5><?php _e($vars['feed_title']); ?></h5>
	<ul class="rssfeed">
	<?php
	$rss->items = array_slice($rss->items, 0, $vars['number']);
	foreach ($rss->items as $item ) {
	?>
		<li><a href="<?php echo wp_filter_kses($item['link']); ?>"><?php echo wp_specialchars($item['title']); ?></a><?php if($vars['show_description'] == '1') { ?><p><?php echo $item['description'] ?></p><?php } ?></li>
	<?php } ?>
	</ul>
	<?php }
}
?>